<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<script type="text/javascript" language="javascript">
function validate(){
	alert("reached......");
	var topic=document.getElementById("dt").value;
	var desc=document.getElementById("des").value;
	if(topic==null){
		alert("Please enter Topic!!!!");
	}
	if(desc==null){
		alert("Please enter Description!!!!");
	}
}
</script>
<script type="text/javascript" language="javascript">
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
var xmlhttp;
function postdis(str,str2,str3)
{
    //alert("Reached..");
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="InsertDis.do";
        var str1='<%=(String)session.getAttribute("id")%>';
	url=url+"?p="+str+"&q="+str1+"&r="+str2+"&s="+str3;
	//alert(str+"&"+str1+"&"+str2);
     //alert(url);
	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("POST",url,true);
	xmlhttp.send(null);
}

function stateChanged()
{
	if (xmlhttp.readyState==4)
	{
		var vr=xmlhttp.responseText;
		//alert("Valid...."+vr);
			if(vr==1){
				//document.f1.descrp.value="";
				//document.f1.topic.value="";
                document.getElementById("tvs").innerHTML="<b>Discussion posted Successfully<b>";
				document.getElementById("tvs").style.color="green";
                        }
                        else
			{
				document.getElementById("tvs").innerHTML="<b>Please Try Again<b>";
				document.getElementById("tvs").style.color="red";
			}
			
	}
	
 }

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	if(window.ActiveXObject)
	{
		// code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}


        </script>
<title>Knowledge Share</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet" href="styles/layoutforprofilepage.css" type="text/css" />
       <script src="scripts/slidemenu.js"></script>
        <style type="text/css">
            
            #menu1 {
                background: #676767;
                height: auto;
                width:0px;  
                float:right;
                overflow:hidden;
            }
           /* #menu2 {
                background: #fff;
                height: 100%;
                width:0px;  
                float:right;
                overflow:hidden;
            }
			*/
           #nav-bar {
                background: #2B2B2B;
                height: 615px;
                width:30px; 
                float:right;
            }
            ul.nav-menu{
                padding:0px;
                margin:0;
            }
            ul.nav-menu li{
                list-style-type:none;
                padding:0px;
                width:10px;
                height:400px;
            }
            ul.nav-menu li a{
	display:block;
	width:100px;
	padding:5px;
	position:relative;
	right:42px;
	top:60px;
	color:#2B2B2B;
	text-decoration:none;
	background-color: #2B2B2B;
            }
            ul.nav-menu li a.btn-2{
                top:160px;
            }
            ul.nav-menu li a:hover{
                background-color:#676767;
                color:#2B2B2B;
            }
            
			.rotate {
                -webkit-transform: rotate(-90deg);  /* Safari */
               -moz-transform: rotate(-90deg);     /* Firefox */
                -ms-transform: rotate(-90deg);      /* IE */
                -o-transform: rotate(-90deg);       /* Opera */
                filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* Internet Explorer */
            }
        </style>
		
		<style type="text/css">
		#menu ul
{
    margin: 0px;
    padding: 0px;
    list-style-type: none;
}

#menu a
{
    display:inline-block;
    width: 230px;
	height:60px;
	padding-left:24px;
	padding-top:8px;
	text-transform:uppercase;
    color: white;
    background-color: #676767;
    text-align: left;
}

#menu a:hover
{
    background-color:#2B2B2B;
}
</style>s
</head>
<body id="top">
<div class="wrapper row1">
  <div id="topnav">
    <ul>
      	   <li style="float:right"><a href="logout.jsp"><strong>Log Out</strong></a></li>
    </ul> 
  </div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper row2">
  <div id="header" class="clear">
    <div class="fl_left">
      <h1><a href="../../Documents/index.html">Knowledge Share </a></h1>
      <p>an online knowledge based community sharing system</p>
    </div>
  </div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper row4"></div>
<!-- ####################################################################################################### -->
<div class="wrapper row5">

        <div id="menu1">
		
		<div id="menu">
          <ul>
             <li><a href="startdisc.jsp">Start a Discussion</a></li>
             <li><a href="viewdisclist.jsp">View Discussions</a></li>
             <li><a href="#">Upload Video Tutorials</a></li>
			 <li><a href="#">View Video Tutorials</a></li>
			 <li><a href="#">Upload Study Materials</a></li>
			 <li><a href="#">View Study Materials</a></li>
			 <li><a href="#">Live Sessions</a></li>
			 <li><a href="#">View Assessment report</a></li>
			 <li><a href="viewindustryExpert.jsp">View Industry Experts</a></li>
         </ul>
       </div>
		
		</div>
        <div id="nav-bar">
            <ul class="nav-menu">
                <li>
                <a name="nav" href="#" class="btn-1 rotate"><img src="images/sliderimg.jpg" width="100" height="30" /></a></li>
            </ul>
        </div><!--/nav-bar-->
        <script type="text/javascript">
            $(document).ready(function()
            {
                var $menu1 = $('#menu1');
                //var $menu2 = $('#menu2');

                $('.btn-1').toggle(
                function()
                {
                    if ($menu1.width() == 250)
                    {
                        $('#menu1').animate({width: "0"}, 500);
                    }
                    else {
                        //$('#menu2').animate({width:'0px'},500);
                        $('#menu1').delay(500).animate({width:'250px'},500);
                    } 
                },
                function()
                {
                    if ($menu1.width() == 250)
                    {
                        $('#menu1').animate({width: "0"}, 500);
                    }
                    else {
                        //$('#menu2').animate({width:'0px'},500);
                        $('#menu1').delay(500).animate({width:'250px'},500);
                    }
                });

             });
        </script>
  <div id="container" class="clear">
    <!-- ####################################################################################################### -->
    <%!String dept=null; %>
    <%
    session.getAttribute("id");
    dept=(String)session.getAttribute("dept");
    %>
	<form name="f1" method="post" >
	<table>
	<input type="hidden" name="deptid" value="<%=dept%>"/>
	  <tr><td width="23%">Enter Discussion Topic</td>
	  <td width="77%"><input type="text" name="topic" id="dt" size="100px" /></td></tr>
	  <tr><td>Description </td><td><textarea name="descrp" id="des" cols="100" rows="10"></textarea></td></tr>
	</table>  
	<input type="button" value="CREATE" onclick="postdis(f1.topic.value,f1.descrp.value,f1.deptid.value);validate();"style="background-color:#2B2B2B; color:#FFFFFF; border:ridge;" />
	</form>
     <span id="tvs"></span>
    <a href="viewdisclist.jsp"><h2> GO TO DISCUSSIONS </h2></a>
    <!-- ####################################################################################################### -->
  </div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper"></div>
<!-- ####################################################################################################### -->
<div class="wrapper">
  <div id="footer" class="clear">
    <!-- ####################################################################################################### -->
   
    <div id="copyright" class="clear">
      <p class="fl_left">Copyright &copy; 2012 - All Rights Reserved</p>
      <p class="fl_right">Team CodeX</p>
    </div>
    <!-- ####################################################################################################### -->
  </div>
</div>
</body>
</html>